package com.atmilan.quartz.model.dto.orange;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * orange商品映射对象
 * @Description:
 * @author daigb
 * @date 2021-06-02
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrangeProductResDTO {

    private String code;

    private String message;

    /**
     * 是否成功 0不成功 1成功
     */
    private Integer success;

    private OrangeData data;

    @Data
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class OrangeData {
        @ApiModelProperty(value = "商品总数量")
        private Integer total;

        /**
         * 商品数据
         */
        @JsonProperty(value = "itemList")
        private List<OrangeGoodsRes> itemList;

        @Data
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class OrangeGoodsRes {
            @ApiModelProperty(value = "商品id")
            @JsonProperty(value = "id")
            private String itemId;

            @ApiModelProperty(value = "品牌名称")
            private String brandName;

            @ApiModelProperty(value = "组商品id 代表这商品归属到某一组下的商品 目前暂无")
            private String groupId;

            @ApiModelProperty(value = "一级类目名称")
            private String firstCateName;

            @ApiModelProperty(value = "二级类目名称")
            private String secondCateName;

            @ApiModelProperty(value = "三级类目名称")
            private String thirdCateName;

            @ApiModelProperty(value = "一级类目id")
            private Long firstCateId;

            @ApiModelProperty(value = "二级类目id")
            private Long secondCateId;

            @ApiModelProperty(value = "三级类目id")
            private Long thirdCateId;

            @ApiModelProperty(value = "货币单位 参考货币字典")
            private String currency;

            @ApiModelProperty(value = "商品名称")
            private String name;

            @ApiModelProperty(value = "商品原始标题")
            private String originalName;

            @ApiModelProperty(value = "店铺名称")
            private String shopName;

            @ApiModelProperty(value = "商品描述")
            private String desc;

            @ApiModelProperty(value = "图文详情 html片段")
            private String richDesc;

            @ApiModelProperty(value = "是或赠品( 0不是 1是)")
            private Integer gift;

            @ApiModelProperty(value = "是否预售商品(0不是 1是)")
            private Integer presell;

            @ApiModelProperty(value = "商品上下架状态(0下架 1上架) 下架商品即为不可售")
            private Integer shelfStatus;

            @ApiModelProperty(value = "图片数组")
            private String[] imageList;

            @ApiModelProperty(value = "商品总规格信息")
            private List<SkuNameValue> skuNameValues;

            @Data
            @JsonIgnoreProperties(ignoreUnknown = true)
            public static class SkuNameValue {

                @ApiModelProperty(value = "规格名称")
                private String skuName;

                @ApiModelProperty(value = "规格名称")
                private List<SkuValue> skuValues;

                @Data
                @JsonIgnoreProperties(ignoreUnknown = true)
                public static class SkuValue {
                    @ApiModelProperty(value = "规格值")
                    private String skuValue;

                    @ApiModelProperty(value = "规格对应的图片数组")
                    private String[] imageUrlList;
                }

            }

            @ApiModelProperty(value = "商品规格信息")
            private List<Sku> skuList;

            @Data
            @JsonIgnoreProperties(ignoreUnknown = true)
            public static class Sku {
                @ApiModelProperty(value = "商品id")
                private String itemId;

                @ApiModelProperty(value = "规格id")
                private String skuId;

                @ApiModelProperty(value = "重量")
                private Double weight;

                @ApiModelProperty(value = "单位 例如：件、组、盒、支")
                private String unit;

                @ApiModelProperty(value = "单位对应的数量 与单位共用 如：1件、1组、1盒、1支")
                private Integer unitQuantity;

                @ApiModelProperty(value = "商品总数量")
                private Integer totalStock;

                @ApiModelProperty(value = "规格信息")
                private List<SkuValue> skuValues;

                @ApiModelProperty(value = "对应渠道信息")
                private List<SkuChannel> skuChannels;

                @Data
                @JsonIgnoreProperties(ignoreUnknown = true)
                public static class SkuValue {
                    @ApiModelProperty(value = "规格名")
                    private String skuName;
                    @ApiModelProperty(value = "规格值")
                    private String skuValue;
                }

                @Data
                @JsonIgnoreProperties(ignoreUnknown = true)
                public static class SkuChannel {
                    @ApiModelProperty(value = "渠道名称")
                    private String channelName;

                    @ApiModelProperty(value = "渠道类型")
                    private String channelType;

                    @ApiModelProperty(value = "现价（实际采购价）")
                    private Double price;

                    @ApiModelProperty(value = "原价（建议零售价）")
                    private Double originalPrice;

                    @ApiModelProperty(value = "当前渠道商品的库存数")
                    private Integer stock;

                    @ApiModelProperty(value = "商品编码 如果系统需要在会订货系统导入订单 需要使用到")
                    private String itemCode;

                    @ApiModelProperty(value = "商品销售状态(0为不可售 1可售)")
                    private String salesStatus;
                }

            }
        }

    }

}
